<template>	
	<view>
        <web-view :webview-styles="webviewStyles" :src="picUrl"></web-view>
    </view>
</template>

<script>
	 export default {
	        data() {
	            return {
					type : null,
					picUrl : 1,
					baseUrl : this.$mConfig.baseUrl,
					cstmId: null,
	                webviewStyles: {
	                    progress: {
	                        color: '#FF3333'
	                    }
	                }
	            }
	        },
			onLoad(option) {
				console.log("option: " + JSON.stringify(option));
				this.type = option.type;
				this.cstmId = option.cstmId;
				let title = '日报';
				if(this.type =='日报')
				   this.picUrl = `${this.baseUrl}/sdSleepStudyController.do?sleepDayDetail&cstmId=${this.cstmId}`
				else if(this.type =='周报')
				    this.picUrl = `${this.baseUrl}/sdSleepStudyController.do?sleepWeekDetail&cstmId=${this.cstmId}`
				else if(this.type =='月报')   
				    this.picUrl = `${this.baseUrl}/sdSleepStudyController.do?sleepMonthDetail&cstmId=${this.cstmId}`
				
				  uni.setNavigationBarTitle({
				  	title: this.type
				  })
				
			}
	    }
</script>

<style>
</style>
